package main

import (
	"context"
	"github.com/reugn/go-quartz/quartz"
	"taskmod/task"
	"time"
)

func main() {
	ctx := context.Background()
	schedule := quartz.NewStdScheduler()
	schedule.Start(ctx)
	cronTrigger, err := quartz.NewCronTrigger("1/5 * * * * *")
	if err != nil {
		panic(err)
	}
	var cronJob = new(task.CronJob)
	cronJob.Desc = "CronJob"
	cronJob.InstanceID = "1111"
	err1 := schedule.ScheduleJob(ctx, cronJob, cronTrigger)
	if err1 != nil {
		panic(err1)
	}
	time.Sleep(time.Second * 1000)
}
